load("@rules_go//go:def.bzl", "go_library", "go_test")

# gazelle:go_test file

go_test(
    name = "admin_test",
    size = "small",
    srcs = ["admin_test.go"],
    pure = "on",
    shard_count = 4,
    deps = [
        ":testing",
        "//src/auth",
        "//src/internal/backoff",
        "//src/internal/client",
        "//src/internal/errors",
        "//src/internal/protoutil",
        "//src/internal/require",
        "//src/internal/testutil",
        "//src/internal/uuid",
        "//src/pfs",
        "//src/pps",
    ],
)

go_test(
    name = "auth_test",
    size = "small",
    srcs = ["auth_test.go"],
    pure = "on",
    shard_count = 12,
    deps = [
        ":testing",
        "//src/auth",
        "//src/debug",
        "//src/internal/authdb",
        "//src/internal/backoff",
        "//src/internal/client",
        "//src/internal/cmdutil",
        "//src/internal/dockertestenv",
        "//src/internal/errors",
        "//src/internal/grpcutil",
        "//src/internal/middleware/auth",
        "//src/internal/pachd",
        "//src/internal/pctx",
        "//src/internal/protoutil",
        "//src/internal/require",
        "//src/internal/testpachd/realenv",
        "//src/internal/testutil",
        "//src/internal/uuid",
        "//src/pfs",
        "//src/pps",
        "//src/server/auth/server",
        "//src/server/pfs",
        "@com_github_minio_minio_go_v6//:minio-go",
        "@org_golang_google_protobuf//types/known/emptypb",
    ],
)

go_test(
    name = "config_test",
    size = "small",
    srcs = ["config_test.go"],
    pure = "on",
    deps = [
        "//src/auth",
        "//src/identity",
        "//src/internal/backoff",
        "//src/internal/dockertestenv",
        "//src/internal/errors",
        "//src/internal/pctx",
        "//src/internal/require",
        "//src/internal/testpachd/realenv",
        "//src/internal/testutil",
        "//src/internal/uuid",
        "//src/server/auth/server",
        "@org_golang_google_protobuf//proto",
    ],
)

go_test(
    name = "oidc_test",
    size = "small",
    srcs = ["oidc_test.go"],
    pure = "on",
    deps = [
        "//src/auth",
        "//src/internal/dockertestenv",
        "//src/internal/pctx",
        "//src/internal/require",
        "//src/internal/testpachd/realenv",
        "//src/internal/testutil",
    ],
)

go_library(
    name = "testing",
    srcs = ["common.go"],
    importpath = "github.com/pachyderm/pachyderm/v2/src/server/auth/server/testing",
    visibility = ["//visibility:public"],
    deps = [
        "//src/auth",
        "//src/internal/config",
        "//src/internal/dockertestenv",
        "//src/internal/pctx",
        "//src/internal/require",
        "//src/internal/testpachd/realenv",
        "//src/internal/testutil",
        "//src/pfs",
        "//src/pps",
    ],
)
